-
Notifications
You must be signed in to change notification settings - Fork 63
feat: Encryption tests for integration-browser #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
https://github.com/awslabs/aws-crypto-tools-test-vector-framework defines an encryption manifest. This manifest should be used to maintain cross compatibility of language implementations. Then integrate this into the CI integration tests. Also update package.json to better organize parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
needs(response.ok, `Failed to decrypt: ${toUtf8(body)}`) | ||
expect(plainText).toEqual(new Uint8Array(body)) | ||
} catch (e) { | ||
if (!notSupportedMessages.includes(e.message)) throw e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't suppose there's a better way to handle specific error types that isn't just string parsing? It looks like if one of those error messages changes the logic here breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There maybe. But that would be an extensive change to the ESDK that I may make...
import got from 'got' | ||
|
||
export async function buildEncryptFixtures (fixtures: string, manifestFile: string, keyFile: string, testName: string, slice: string) { | ||
const [start = 0, end = 9999] = (slice || '').split(':').map(n => parseInt(n, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: This smells funny.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very funny. Just me working around some cmd line parsing :(
Humans are difficult interfaces...
https://github.com/awslabs/aws-crypto-tools-test-vector-framework defines an encryption manifest.
This manifest should be used to maintain cross compatibility of language implementations.
Then integrate this into the CI integration tests.
Also update package.json to better organize parameters.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.